﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Web.SessionState;
using System.Web.Profile;
using System.Web.UI.HtmlControls;

namespace WebSite.admin
{
    public partial class Index :BaseAdmin
    {
        public string InphoneNumber = "";
        // Methods
        private void Bind()
        {
            string sSource = fun.geturl("");
            //if (((sSource != "127.0.0.1") && (fun.Left(sSource, 7) != "192.168")) && (sSource != "localhost"))
            //{
                if ((re.ReadCookie("code") != null) && (re.ReadCookie("code") != ""))
                {
                    string regname = fun.ReadValue("Sitezcn");
                    string regcode = fun.ReadValue("Sitezcv");
                    if (!(fun.weburl("", sSource, regname, regcode).ToString() == re.ReadCookie("code").ToString()))
                    {
                        base.Response.Write("<script language=javascript src=website.aspx></script>");
                    }
                }
                //else
                //{
                //    base.Response.Write("<script language=javascript src=website.aspx></script>");
                //}
           // }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Session["Adminlogin"] == null)
            {
                Response.Redirect("login.aspx");
               // base.Response.Write("<script language=javascript>window.top.location.href='admin/login.aspx';</script>");
             //   base.Response.End();
            }
            if (!base.IsPostBack)
            {
                if (this.Session["inphoneNumber"] != null)
                {
                    InphoneNumber = this.Session["inphoneNumber"].ToString();
                }
                this.Bind();
            }
        }



    }
}